<?php


namespace app\zhongmaotong\model;

use think\Model;

class SpuModel extends Model
{
    protected $name='spk';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = false;

    public function spu()
    {
        return $this->hasOne(SpucopyModel::class,'id','gid');
    }

    public function getImagesAttr($value)
    {
        return explode(',',$value);
    }

}